﻿// -----------------------------------------------------------------------
// <copyright file="FrenchPluralRules.cs" company="Moveax, LLC">
// Copyright (c) 2013 Andrey Veselov. All rights reserved.
// License:  Microsoft Public License (MS-PL)
// Contacts: http://andrey.moveax.com andrey@moveax.com
// </copyright>
// -----------------------------------------------------------------------

namespace Moveax.Pluralization.Core.LanguageRules
{
    using System;

    /// <summary>Language plural rules for: Akan, Amharic, Bihari, Filipino, French, Fulah, Gun, Hindi, Kabyle, Lingala, Malagasy, Northern Sotho, Tagalog, Tigrinya, Walloon.</summary>
    internal class FrenchPluralRules : IPluralRules
    {
        public string LanguageCode { get { return "fr"; } }

        public PluralCategory GetCategoryFor(int value)
        {
            int absValue = Math.Abs(value);

            return 0 <= absValue && absValue < 2 ?
                PluralCategory.One :
                PluralCategory.Other;
        }

        public PluralCategory GetCategoryFor(float value)
        {
            float absValue = Math.Abs(value);

            return 0.0f <= absValue && absValue < 2.0f ?
                PluralCategory.One :
                PluralCategory.Other;
        }
    }
}
